package com.miao.im.service.message;

import reactor.core.publisher.Mono;

import java.util.List;
import java.util.Map;

/**
 * @Auther: miaoguoxin
 * @Date: 2021/3/15 16:08
 * @Description:
 */
public interface IMessageManager {
    /**
     * 保存离线消息
     * @author miaoguoxin
     * @date 2021/3/18
     */
    Mono<Void> save(ChatMessage chatMessage);

    /**
     * @Description: 获取个人分页数据
     * @Author: miaoguoxin
     * @Date: 2021/3/20
     */
    Mono<List<ChatMessage>> getPersonalPage(Long userId, Long targetId, Integer targetType, long pageNum, Integer pageSize);

    /**
     * @Description: 获取离线消息计数
     * @Author: miaoguoxin
     * @Date: 2021/4/24
     */
    Map<String, OfflineMessageCounter> getOfflineMsgCounter(Long userId);

    /**
    * @Description: 删除离线消息计数器
    * @Author: miaoguoxin
    * @Date: 2021/4/24
    */
    void delOfflineCounter(Long userId);

    /**
     * @Description: 范围删除个人消息
     * @Author: miaoguoxin
     * @Date: 2021/3/20
     */
    Mono<Void> deletePersonalRange(Long userId, Long targetId, Integer targetType, long startTimestamp, long endTimestamp);
}
